#pragma once

#include <Wincrypt.h>
#include <Windows.h>
class CNateCrypt
{
public:
	CNateCrypt();
	CNateCrypt( BYTE* bHashKey );
	virtual ~CNateCrypt(void);

public :
	BOOL encryptMessage( IN OUT BYTE* pMsg );
	BOOL decryptMessage( IN OUT BYTE* pMsg, DWORD nReadSize );
	BOOL encryptFileTo( IN LPCTSTR pszSourceFile );
	BOOL decryptFileTo( IN LPCTSTR pszSourceFile, OUT CString &msBackupFilePath );	

private :
	HCRYPTPROV    hProv_;
	HCRYPTHASH    hHash_;
	HCRYPTKEY     hKey_;

	HANDLE createFile( LPTSTR pszSourceFile, DWORD dwDesiredAccess, DWORD dwCreationDisposition );

};

